package org.dromara.wms.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.tenant.core.TenantEntity;

import java.io.Serial;
import java.util.Date;

/**
 * 库存数量对象 wms_stock
 *
 * @author wenrui Su
 * @date 2024-05-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_stock")
public class WmsStock extends TenantEntity {

@Serial
private static final long serialVersionUID=1L;


  @ExcelProperty(value = "ID")
  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "物品码")
  @NotNull(message = "物品码不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long productId;

  @ExcelProperty(value = "单位")
  @NotBlank(message = "单位不能为空", groups = { AddGroup.class, EditGroup.class })
  private String measureUnit;

  @ExcelProperty(value = "批次号")
  @NotBlank(message = "批次号不能为空", groups = { AddGroup.class, EditGroup.class })
  private String batchCode;

  @ExcelProperty(value = "仓库")
  @NotNull(message = "仓库不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long warehouseId;

  @ExcelProperty(value = "库位")
  private Long areaId;

  @ExcelProperty(value = "供应商")
  private Long supplierId;

  @ExcelProperty(value = "生产厂商")
  private Long manufacturerId;

  @ExcelProperty(value = "在库数量")
  @NotNull(message = "在库数量不能为空", groups = { AddGroup.class, EditGroup.class })
  private Double quantity;

  @ExcelProperty(value = "采购单价")
  private Double purchasePrice;

  @ExcelProperty(value = "库存有效期")
  private Date expireDate;

  @ExcelProperty(value = "备注")
  private String remark;
  /* 其他表字段 */
  @TableField(exist = false)
  @ExcelProperty(value = "产品名")
  private String productName;

  @TableField(exist = false)
  @ExcelProperty(value = "规格")
  private String specification;

  @TableField(exist = false)
  @ExcelProperty(value = "单价")
  private Double Price;

  @TableField(exist = false)
  @ExcelProperty(value = "仓库")
  private String wareName;

  @TableField(exist = false)
  @ExcelProperty(value = "供应商名称")
  private String partnerName;

  @TableField(exist = false)
  @ExcelProperty(value = "是否库存")
  private Boolean isStock;

  @TableField(exist = false)
  @ExcelProperty(value = "可否销售")
  private Boolean isSales;

  @TableField(exist = false)
  @ExcelProperty(value = "是否物料")
  private Boolean isMaterial;

  @TableField(exist = false)
  @ExcelProperty(value = "产品编码")
  private String sku;
}
